import { getAction, postAction } from '@/api/manage'

// 根据编码获取数据字典
const listByCode = (params) => getAction('/admin/dataDict/listByCode', params)
// 获取全部数据字典
const all = (params) => getAction('/admin/dataDict/all', params)
// 数据字典列表
const list = (params) => getAction('/admin/dataDict/page', params)
// 删除数据字典
const del = (params) => postAction(`/admin/dataDict/delete/${params}`)
// 批量删除数据字典
const batchDel = (params) => postAction(`/admin/dataDict/batchDel`, params)
// 新增数据字典
const create = (params) => postAction('/admin/dataDict/create', params)
// 编辑数据字典
const edit = (params) => postAction('/admin/dataDict/update', params)
// 导出数据字典
const exports = (params) => postAction('/admin/dataDict/export', params, 'blob')
// 下载数据字典模板
const download = (params) => postAction('/admin/dataDict/download', params, 'blob')
// 导入数据字典
const imports = (params) => postAction('/admin/dataDict/import', params)

export {
  listByCode,
  all,
  list,
  del,
  batchDel,
  create,
  edit,
  exports,
  download,
  imports
}
